package me.zhengjie.config;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

/**
 * 地磅数据中的特殊地址，有些地址为缩写、有谬误或高德地图未即时更新，需要手动更正
 */
@Getter
@AllArgsConstructor
public enum SpecialAddressEnum {

    HUAFA("华发", "华发仁恒·四季河滨(建设中)", "虎丘区", new BigDecimal("120.753324"), new BigDecimal("31.294181")),
    SUZHOUHUANWEI("苏州环卫", "苏州环卫", "工业园区", new BigDecimal("120.717093"), new BigDecimal("31.322206"));

    //特殊地址
    public final String address;
    //实际地址
    public final String realAddress;
    //所在辖区
    public final String district;
    //高德坐标系（火星坐标系）的经纬度
    public final BigDecimal lng;//经度
    public final BigDecimal lat;//纬度

    public static final Map<String, SpecialAddressEnum> addressMap = new HashMap<>();
    static {
        for (SpecialAddressEnum addressEnum: SpecialAddressEnum.values()) {
            addressMap.put(addressEnum.getAddress(), addressEnum);
        }
    }

    public static SpecialAddressEnum getSpecialAddress(String address) {
        return addressMap.get(address);
    }

}

